home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-PPC / IRQ.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  3KB  |  115 lines

  1. #include <linux/config.h>
  2.  
  3. #ifndef _ASM_IRQ_H
  4. #define _ASM_IRQ_H
  5.  
  6. #include <asm/processor.h>        /* for is_prep() */
  7.  
  8. extern void disable_irq(unsigned int);
  9. extern void enable_irq(unsigned int);
  10.  
  11. #ifndef CONFIG_8xx
  12.  
  13. #ifdef CONFIG_APUS
  14. #define enable_irq m68k_enable_irq
  15. #define disable_irq m68k_disable_irq
  16. #include <asm-m68k/irq.h>
  17. #undef enable_irq
  18. #undef disable_irq
  19. #else /* CONFIG_APUS */
  20.  
  21. /*
  22.  * this is the # irq's for all ppc arch's (pmac/chrp/prep)
  23.  * so it is the max of them all - which happens to be powermac
  24.  * at present (G3 powermacs have 64).
  25.  */
  26. #define NR_IRQS            128
  27.  
  28. #endif /* CONFIG_APUS */
  29.  
  30. #define NUM_8259_INTERRUPTS    16
  31. #define NUM_OPENPIC_INTERRUPTS    20
  32. #define is_8259_irq(n)        ((n) < NUM_8259_INTERRUPTS)
  33. #define openpic_to_irq(n)    ((n)+NUM_8259_INTERRUPTS)
  34. #define irq_to_openpic(n)    ((n)-NUM_8259_INTERRUPTS)
  35. #define IRQ_8259_CASCADE    NUM_8259_INTERRUPTS
  36.  
  37. #ifndef CONFIG_APUS
  38. /*
  39.  * This gets called from serial.c, which is now used on
  40.  * powermacs as well as prep/chrp boxes.
  41.  * Prep and chrp both have cascaded 8259 PICs.
  42.  */
  43. static __inline__ int irq_cannonicalize(int irq)
  44. {
  45.     return (((is_prep || is_chrp) && irq == 2) ? 9 : irq);
  46. }
  47. #endif
  48.  
  49. #else /* CONFIG_8xx */
  50.  
  51. /* The MPC8xx cores have 16 possible interrupts.  There are eight
  52.  * possible level sensitive interrupts assigned and generated internally
  53.  * from such devices as CPM, PCMCIA, RTC, PIT, TimeBase and Decrementer.
  54.  * There are eight external interrupts (IRQs) that can be configured
  55.  * as either level or edge sensitive. 
  56.  * On the MBX implementation, there is also the possibility of an 8259
  57.  * through the PCI and PCI-ISA bridges.
  58.  */
  59. #define NR_IRQS    (16+16) /* 8259 has 16, too -- Cort */
  60.  
  61. #define    SIU_IRQ0    (0+16)    /* Highest priority */
  62. #define    SIU_LEVEL0    (1+16)
  63. #define    SIU_IRQ1    (2+16)
  64. #define    SIU_LEVEL1    (3+16)
  65. #define    SIU_IRQ2    (4+16)
  66. #define    SIU_LEVEL2    (5+16)
  67. #define    SIU_IRQ3    (6+16)
  68. #define    SIU_LEVEL3    (7+16)
  69. #define    SIU_IRQ4    (8+16)
  70. #define    SIU_LEVEL4    (9+16)
  71. #define    SIU_IRQ5    (10+16)
  72. #define    SIU_LEVEL5    (11+16)
  73. #define    SIU_IRQ6    (12+16)
  74. #define    SIU_LEVEL6    (13+16)
  75. #define    SIU_IRQ7    (14+16)
  76. #define    SIU_LEVEL7    (15+16)
  77.  
  78. /* The internal interrupts we can configure as we see fit.
  79.  * My personal preference is CPM at level 2, which puts it above the
  80.  * MBX PCI/ISA/IDE interrupts.
  81.  */
  82. #define PIT_INTERRUPT        SIU_LEVEL0
  83. #define CPM_INTERRUPT        SIU_LEVEL2
  84. #define PCMCIA_INTERRUPT    SIU_LEVEL6
  85. #define DEC_INTERRUPT        SIU_LEVEL7
  86.  
  87. /* Some internal interrupt registers use an 8-bit mask for the interrupt
  88.  * level instead of a number.
  89.  */
  90. #define    mk_int_int_mask(IL) (1 << (7 - (IL/2)))
  91.  
  92. #ifdef CONFIG_MBX
  93. /* These are defined (and fixed) by the MBX hardware implementation.*/
  94. #define POWER_FAIL_INT    SIU_IRQ0    /* Power fail */
  95. #define TEMP_HILO_INT    SIU_IRQ1    /* Temperature sensor */
  96. #define QSPAN_INT    SIU_IRQ2    /* PCI Bridge (DMA CTLR?) */
  97. #define ISA_BRIDGE_INT    SIU_IRQ3    /* All those PC things */
  98. #define COMM_L_INT    SIU_IRQ6    /* MBX Comm expansion connector pin */
  99. #define STOP_ABRT_INT    SIU_IRQ7    /* Stop/Abort header pin */
  100. #endif /* CONFIG_MBX */
  101.  
  102. #ifdef CONFIG_FADS
  103. #define FEC_INTERRUPT    SIU_LEVEL1    /* FEC interrupt */
  104. #endif
  105.  
  106. /* always the same on MBX -- Cort */
  107. static __inline__ int irq_cannonicalize(int irq)
  108. {
  109.     return irq;
  110. }
  111.  
  112. #endif /* CONFIG_8xx */
  113.  
  114. #endif
  115.